cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR)
project(plugin_d)

if(WIN32)
    add_definitions(-DAFID_EXPORTS)
endif()

file(GLOB_RECURSE APIS api/*.h)
file(GLOB_RECURSE SRCS api/* src/*.h src/*.cpp)
# if(WIN32)
#     list(APPEND   SRCS src/plugin_d.rc)
# endif()

include_directories(
    ${INC_PATH}/x3py
    api
    src
    )

if(WIN32)
    add_definitions(
        )
endif()

add_library(plugin_d SHARED ${SRCS})
add_custom_command(TARGET plugin_d POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E make_directory               ${INC_PATH}/plugin_d
    COMMAND ${CMAKE_COMMAND} -E copy ${APIS}                 ${INC_PATH}/plugin_d
    # COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:plugin_d> ${PLUGINS_PATH}/$<TARGET_FILE_NAME:plugin_d>
    COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:plugin_d> ${PLUGINS_PATH})

